-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move WindowOrWorkerGlobalScope features to api.* (_globals folder) #11518
Conversation
I'm still undecided on splitting or lumping here, but I do have thoughts on this:
Seems to me, since we're doing something quite similar to mixins in this approach, that we could do something similar and avoid changing the schema:
|
That seems a lot better, yes. (although more work). What do we define as "globals", though? I guess there are more features that qualify outside of |
There are a few additional properties that are on the global object in both window and worker contexts to consider here, namely
There's also the interesting case of Similarly, both have a |
Oh, |
Indeed, there are some APIs available only on
Some are actually pretty entwined with the main thread, I would be happy enough with a guidelines saying that only things available in more than one global scope should be given the globals treatment. An objective rule would at least make it easier on tooling (like mdn-bcd-collector) to map from Web IDL to BCD paths. |
Done! Much better |
Right, it would be good to get a list of "globals" derived from Web IDL syntax. |
Question: how do we deal with recent global scopes like |
It's not really because it's a namespace, rather it's because of |
The only way of defining global method or properties using Web IDL is to add stuff to I would say only methods or properties added to more than one global scope should count. The tricky bit is determining from Web IDL if they are the same, or just share a name. For So, even though a rule involving This does require human judgement, but I think in practice it will be possible to infer from the state of Web IDL at any given time, it's just that the rule might have to evolve with changes to specs and Web IDL itself. Another option I think we should discard: Simplest possible ruleThe simplest we could do is to say that anything exposed on any global object is a global. Unfortunately, this leads to the silly conclusion that This also wouldn't work for |
@Elchi3 do you want to change the title of this PR? It's not unifying all of |
I've closed #11517. We'd like to go ahead with this PR. |
@Elchi3 can you resolve conflicts? Even without conflicts there's probably a risk that something has changed since the PR was created, so how to verify that this isn't accidentally reverting any data? |
Ah yes, I should probably re-do this entirely. |
245f2aa
to
f8f44f8
Compare
f8f44f8
to
b019e09
Compare
Okay running into difficulties here... I can't move |
This reverts commit 998bc0a.
I reverted the crypto change. I think we should deal with it in a follow-up. |
This sounds like a major change at least for code generators, not sure why it didn't even got a minor version up 👀 |
Thanks for your feedback. I released this according to https://github.com/mdn/browser-compat-data#semantic-versioning-policy.
Like other mixins, WindowOrWorkerGlobalScope was not a protected namespace per this policy. However, I'd like to understand how you consume BCD and what needs to be taken into account for "code generators". |
Some adaptation in mdn-bcd-collector will be needed too. The problem is basically how to create a mapping between Web IDL and BCD paths. Previously, assuming mixin flattening, the path for |
So mixin flattening would have been the preferred approach? I'm a bit puzzled now... |
Non-breaking rather than preferred, I guess |
No, this is exactly the approach I prefer, I'm just saying what changes will be needed in IDL<->BCD mapping. |
I personally think that this was a significant enough change that a minor bump should have been made, if not a major bump. Consumers have shown concern for when features have moved around or been removed, and I feel that we should help communicate these changes with our version numbers. A change like this was versioned properly according to our guidelines, but maybe we should revise them a little? |
This was missed in mdn#11518. This is defined using WindowOrWorkerGlobalScope in the spec: https://w3c.github.io/hr-time/#the-performance-attribute None of the data was validated or changed, just moved.
* Move the performance attribute to api.performance (in _globals) This was missed in #11518. This is defined using WindowOrWorkerGlobalScope in the spec: https://w3c.github.io/hr-time/#the-performance-attribute None of the data was validated or changed, just moved. * Update api/_globals/performance.json Co-authored-by: Florian Scholz <fs@florianscholz.com> Co-authored-by: Florian Scholz <fs@florianscholz.com>
This PR illustrates unifying Window and WorkerGlobalScope in a globals.json file and marking worker support in sub features.
The alternate approach is a split, see #11517
Context: #9127